/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.merak.example.business;

import java.io.File;

import org.merak.core.web.HttpRequest;
import org.merak.core.web.HttpResponse;
import org.merak.core.web.WebParameter;
import org.merak.core.web.mvc.PublicBusinessLogic;

public class RequestFile extends PublicBusinessLogic {

	//~ Attributes ///////////////////////////////////////////////////////////////
	//****************************************************************************
	private final static String view = null;

	//~ Methods //////////////////////////////////////////////////////////////////
	//****************************************************************************
	@Override
	public String execute(HttpRequest request, HttpResponse response)
		throws Exception
	{

		// Request remote data and prepare the local output file

		WebParameter p = request.getOctetStream();
		System.out.println( p.getName() );
		System.out.println( p.getValue() );
		//System.out.println( p.toString() );

		File output = new File("c://octet.txt");
		p.getFile(output);

		// return the text
		return view;

	}
	//****************************************************************************

}
